import { ICollider } from "../../Physics3D/interface/ICollider";
import { ContactPoint } from "./ContactPoint";
import { PhysicsColliderComponent } from "./PhysicsColliderComponent";

/**
 * @en The Collision class is used to create physical collision information.
 * @zh Collision 类用于创建物理碰撞信息。
 */
export class Collision {
    /**@internal */
    _lastUpdateFrame = -2147483648/*int.MIN_VALUE*/;
    /**@internal */
    _updateFrame = -2147483648/*int.MIN_VALUE*/;
    /**@internal */
    _isTrigger = false;

    /**@internal */
    _colliderA: ICollider;
    /**@internal */
    _colliderB: ICollider;

    /**
     * @readonly
     * @en List of collision information generated by collision.
     * @zh 碰撞产生的碰撞信息列表。
     */
    contacts: ContactPoint[] = [];
    /**
     * @readonly
     * @en Another collision object involved in the collision.
     * @zh 碰撞中涉及的另一个碰撞体组件。
     */
    other: PhysicsColliderComponent;

    /**@internal */
    _inPool: boolean = false;
    /**
     * @en constructor of Collision.
     * @zh Collision构造方法。
     */
    constructor() {

    }

    /**
     * @internal
     */
    _setUpdateFrame(farme: number): void {
        this._lastUpdateFrame = this._updateFrame;//TODO:为啥整两个
        this._updateFrame = farme;
    }

}


